package config

import (
	"flag"
	"io"
	"os"
)

// DefiConfigPath 	默认的config path获取
func DefiConfigPath(s ...string) string {
	var filepath = ""

	if len(s) > 0 {
		return s[0]
	}

	set := flag.NewFlagSet("", flag.ContinueOnError)
	set.StringVar(&filepath, "c", "./data/config.yaml", "use config path")
	set.SetOutput(io.Discard)
	set.Parse(os.Args[1:])

	return filepath
}
